<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.time.StopWatch</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.time.StopWatch";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.time.StopWatch.html" class="symbol">tango.time.StopWatch</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Feb 2007: Initial release
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">struct <a class="symbol _struct" name="StopWatch" href="./htmlsrc/tango.time.StopWatch.html#L65" kind="struct" beg="65" end="155">StopWatch</a>; <span class="attrs">[<span class="prot">public</span>]</span> <a title="Permalink to this symbol" href="#StopWatch" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L65">#</a></dt>
<dd class="ddef">
<div class="summary">Timer for measuring small intervals, such as the duration of a 
        subroutine or other reasonably small period.
        <pre class="d_code">
<span class="i">StopWatch</span> <span class="i">elapsed</span>;

<span class="i">elapsed</span>.<span class="i">start</span>;

<span class="lc">// do something</span>
<span class="lc">// ...</span>

<span class="k">double</span> <span class="i">i</span> = <span class="i">elapsed</span>.<span class="i">stop</span>;
</pre></div>
The measured interval is in units of seconds, using floating-
        point to represent fractions. This approach is more flexible 
        than integer arithmetic since it migrates trivially to more
        capable timer hardware (there no implicit granularity to the
        measurable intervals, except the limits of fp representation)
<p class="bl"/>
        StopWatch is accurate to the extent of what the underlying OS
        supports. On linux systems, this accuracy is typically 1 us at 
        best. Win32 is generally more precise. 
<p class="bl"/>
        There is some minor overhead in using StopWatch, so take that into 
        account
<dl>
<dt class="decl">void <a class="symbol _function" name="StopWatch.start" href="./htmlsrc/tango.time.StopWatch.html#L79" kind="function" beg="79" end="82">start</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#StopWatch.start" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L79">#</a></dt>
<dd class="ddef">
<div class="summary">Start the timer</div></dd>
<dt class="decl">double <a class="symbol _function" name="StopWatch.stop" href="./htmlsrc/tango.time.StopWatch.html#L90" kind="function" beg="90" end="93">stop</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#StopWatch.stop" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L90">#</a></dt>
<dd class="ddef">
<div class="summary">Stop the timer and return elapsed duration since start()</div></dd>
<dt class="decl">ulong <a class="symbol _function" name="StopWatch.microsec" href="./htmlsrc/tango.time.StopWatch.html#L101" kind="function" beg="101" end="108">microsec</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#StopWatch.microsec" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L101">#</a></dt>
<dd class="ddef">
<div class="summary">Return elapsed time since the last start() as microseconds</div></dd>
<dt class="decl">static <a class="symbol _sctor" name="StopWatch.this" href="./htmlsrc/tango.time.StopWatch.html#L116" kind="sctor" beg="116" end="126">this</a>(); <a title="Permalink to this symbol" href="#StopWatch.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L116">#</a></dt>
<dd class="ddef">
<div class="summary">Setup timing information for later use</div></dd>
<dt class="decl">ulong <a class="symbol _function" name="StopWatch.timer" href="./htmlsrc/tango.time.StopWatch.html#L134" kind="function" beg="134" end="154">timer</a><span class="params">()</span>; <span class="attrs">[<span class="prot">private</span>, <span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#StopWatch.timer" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.time.StopWatch.html#L134">#</a></dt>
<dd class="ddef">
<div class="summary">Return the current time as an Interval</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2007 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:11 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>